package com.hinner.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户信息表：驼峰命名转下划线。实体类用驼峰，表字段用下划线
 */
@TableName("sys_user")
@Data
public class SysUser extends BaseEntity implements Serializable {


    @TableField(value = "username")
    private String username;
    @TableField(value = "password")
    private String password;
    @TableField(value = "avatar")
    private String avatar;
    @TableField(value = "email")
    private String email;
    @TableField(value = "phonenumber")
    private String phonenumber;

    /**
     * 最后登录时间
     */
    @TableField(value = "login_date")
    private Date loginDate;

    /**
     * 0-正常，1-停用
     */
    @TableField(value = "status")
    private String status;

    // 所属角色，逗号隔开
    @TableField(exist = false)
    private String roles;

    // 旧密码
    @TableField(exist = false)
    private String oldPassword;

    // 新密码
    @TableField(exist = false)
    private String newPassword;

    /**
     * 一个用户可以对应多个角色
     */
    @TableField(exist = false)
    private List<SysRole> sysRoleList;
}
